<template>
    <div v-if="allList" class="ht" id="head">
      <header>
        <span>搜狗有品</span>
      </header>
      <banner-index :loop="true" class="banner" :options="'top'">
          <div class="swiper-slide" v-for="(data,index) in allList[0].list" :key="index">
            <img :src="data.img" />
          </div>
      </banner-index>
      <navbar :column="4">
        <van-grid-item v-for="value in allList[1].list.length" :to="value | ispath(allList[1].list,'link')"
        :key="value" :icon="value | ispath(allList[1].list,'img')" :text="value | ispath(allList[1].list,'name')" />
      </navbar>
      <section>
        <new-frist :newlist="allList[2]"></new-frist>
        <cz-tehui :tehuilist="allList[3]"></cz-tehui>
        <hdimg :imgs="allList[4]"></hdimg>
        <cz-tehui :tehuilist="allList[5]"></cz-tehui>
        <h2>搜狗AI录音笔行业解决方案</h2>
        <banner-index :loop="true" class="banner" :options="'bottom'" style="margin:0;height:100%;">
          <div class="swiper-slide j">
            <img src="//img01.sogoucdn.com/app/a/201029/mod-solution.png" />
            <div  class="ps">
              <div class="tt c" style="color: rgb(60, 156, 255);">
                <div class="">搜狗AI录音笔</div>
                <div class="">让办公更智能</div>
              </div>
              <div class="center">
                <div class="">提升团队整体工作效率及整体素质</div>
                <div class="">帮你打造更具战斗力团队</div>
                <div class="">超额完成工作目标</div>
              </div>
              <div class="btn">
                <button >经典案例</button>
                <button >我要咨询</button>
              </div>
            </div>
          </div>
          <div class="swiper-slide j">
            <img src="//img02.sogoucdn.com/app/a/201029/sale-bg-new.png" />
            <div class="ps">
              <div class="tt" style="color: rgb(60, 156, 255);">
                <div class="">搜狗AI录音笔</div>
                <div class="">让办公更智能</div>
              </div>
              <div class="center">
                <div class="">提升团队整体工作效率及整体素质</div>
                <div class="">帮你打造更具战斗力团队</div>
                <div class="">超额完成工作目标</div>
              </div>
              <div class="btn">
                <button >经典案例</button>
                <button >我要咨询</button>
              </div>
            </div>
          </div>
          <div class="swiper-slide j">
            <img src="//img03.sogoucdn.com/app/a/201029/edu-bg.png" />
            <div class="ps">
              <div class="tt d" style="color: rgb(60, 156, 255);">
                <div class="">搜狗AI录音笔</div>
                <div class="">让办公更智能</div>
              </div>
              <div class="center">
                <div class="">提升团队整体工作效率及整体素质</div>
                <div class="">帮你打造更具战斗力团队</div>
                <div class="">超额完成工作目标</div>
              </div>
              <div class="btn">
                <button >经典案例</button>
                <button >我要咨询</button>
              </div>
            </div>
          </div>
      </banner-index>
      <h2>查找附近的体验店</h2>
      <div style="position:relative" class="rela">
        <img src="//img01.sogoucdn.com/app/a/201029/store.png" height="220" alt="">
        <router-link tag="span" to="/h5/pages/store-map/index">800 + 线下门店为您服务 ></router-link>
      </div>
      </section>
      <footer>
        <h1><img src="//img02.sogoucdn.com/app/a/201029/icon-sogou.png" alt=""></h1>
        <span class="one">搜狗商城让生活更智能更方便</span>
        <span class="phone">400-123-7676</span>
        <ul>
            <li>关于我们</li>
            <li>意见反馈和投诉</li>
            <li>售后服务</li>
            <li>用户协议</li>
        </ul>
      </footer>
      <aside v-scolls="200">
        <span>客服</span>
        <a style="display:none" href="#head" >↑</a>
      </aside>
    </div>
</template>
<script>
import http from '@/util/http'
import bannerIndex from '@/views/index/Banner'
import navbar from '@/views/index/Navbar'
import newFrist from '@/views/index/NewFrist'
import czTehui from '@/views/index/CzTehui'
import hdimg from '@/views/index/Hdimg'
import Vue from 'vue'
Vue.directive('scolls', {
  inserted (el, binding) {
    window.onscroll = () => {
      const target = binding.value || 50
      var t = document.documentElement.scrollTop || document.body.scrollTop
      if (t > target) {
        el.children[1].style.display = 'block'
      } else {
        el.children[1].style.display = 'none'
      }
    }
  }
})
export default {
  data () {
    return {
      allList: null
    }
  },
  filters: {
    ispath (value, path, page) {
      return path[value - 1][page]
    }
  },
  components: {
    bannerIndex,
    navbar,
    newFrist,
    czTehui,
    hdimg
  },
  mounted () {
    http({
      url: '/heihei/json/mobile/new-home.json?c=h5&s=20000&t=1605094041873&v=1.0&autoHandle=false'
    }).then(res => {
      this.allList = res.data.data.mods
    })
  },
  methods: {
    // hankclick (path) {
    //   console.log(path)
    //   this.$router.push(path)
    // }
  }
}
</script>
<style lang="scss" scoped>
.ht{
    background: #f5f5f5;
}
h2{
  font-size: 18px;
  margin: 28px 0 18px 0;
}
header{
  width: 100%;
  margin: 0 auto;
  text-align: center;
  background: #333;
  position: fixed;
  top: 0;
  z-index: 999;
  span{
    display: inline-block;
    line-height: 48px;
    font-size: 18px;
    color: #fff;
  }
}
  .banner{
    margin-top: 48px;
    width: 100%;
    height: 215px;
    img{
      width: 100%;
    }
  }
section{
  margin:0 10px;
}
.j{
  position: relative;
  .ps{
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translate(-50%,0);
    text-align: center;
    .tt{
      font-size: 24px;
      line-height: 30px;
      margin-bottom: 10px;
    }
    .center{
      color: #fff;
      font-size: 14px;
      line-height: 20px;
      margin-bottom: 20px;
    }
    .btn{
      display: flex;
      button{
        background: none;
        border: 0;
        outline: none;
        width: 90px;
        height: 46px;
        color: #fff;
        border: 1px solid #fff;
        line-height: 30px;
        margin-right: 20px;
        padding: 5px 10px;
      }
    }
    .btn button:nth-last-of-type(1){
      color: #333;
      background: #fff;
    }
  }

}
.c{
     div{
       color: #ea413C;
     }
    }
  .d{
     div{
       color: #2de387;
     }
  }
.rela{
  position: relative;
  span{color: #fff;
                padding:0 5px 0 7px;
                border-radius: 30px;
                font-size: 14px;
                border: 1px solid #fff;
                position: absolute;
                bottom: 10px;
                left: 50%;
                transform: translate(-50%,0);
                }
}
footer{
  margin-top: 40px;
  text-align: center;
  h1{
    width: 155px;
    height: 24px;
    margin: 0 auto;
    img{
      width: 100%;
    }
  }
  span:nth-of-type(1){
    // width: ;
    display: block;
    margin: 20px 0;
    color: #8c8c8c;
    font-size: 12px;
  }
  .phone{
    display: inline-block;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 40px;
  }
  ul{
    text-align: center;
    padding-top: 20px;
    padding-bottom: 50px;
    li{
      display: inline-block;
      padding: 5px;
      color: #8c8c8c;
    font-size: 12px;
    }
  }
}
aside{
  span,a{
    position: fixed;
    bottom: 160px;
    right: 30px;
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    text-align: center;
    line-height: 40px;
    z-index: 9999;
    font-size: 14px;
  }
  a{
    bottom: 110px;
  }
}
</style>
